﻿using System;
using CurriculumData;

namespace CurriculumSite
{
    public partial class ProfileImage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Controller controller = new Controller();
            Candidate candidate = controller.GetCandidate(Convert.ToInt32(Request["CandidateId"]));
            if (candidate.PhotoType == null || candidate.Photo == null)
            {
                Response.Redirect("~/Images/NoPhoto.png");
                return;
            }
            Response.ContentType = candidate.PhotoType;
            Response.BinaryWrite(candidate.Photo);
        }
    }
}
